package com.itheima.d1_exception;
/*
    扩展
        1 异常处理的方式
        2 捕获异常执行过程
        3 异常对象常见方法
        4 抛出和捕获异常都支持多态形式
 */
public class Test {
    private String name;
    private Integer age;

    public Test() {
    }

    public Test(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        if (age>=0&&age<=200){
            this.age = age;
        }else {
            throw new RuntimeException("错了,改一下");
        }

    }
}
